package com.tianxinweb.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.tianxinweb.entity.BankCard;
import com.tianxinweb.mapper.BankCardMapper;
import com.tianxinweb.service.BankCardService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cboy
 * @since 2018-08-07
 */
@Service
public class BankCardServiceImpl extends ServiceImpl<BankCardMapper, BankCard> implements BankCardService {

    @Override
    public List<BankCard> getUserBankCard(Integer userId) {
        return selectList(new EntityWrapper<BankCard>().eq("user_id",userId));
    }

    @Override
    public void addBankCard(BankCard bankCard) {
        bankCard.setCardId(null);
        insert(bankCard);
    }
}
